package org.jeecg.modules.htxincailiao.address.domain.vo;

import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.math.BigDecimal;
import java.util.Objects;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.jeecg.common.aspect.annotation.Dict;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotNull;
import org.jeecg.common.util.oConvertUtils;

/**
 * @Description: ht_buyer_address
 * @Author: jeecg-boot
 * @Date: 2021-06-09
 * @Version: V1.0
 */
@Data
@TableName("ht_buyer_address")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "ht_buyer_address对象", description = "ht_buyer_address")
public class HTAddressVO implements Serializable {
    private static final long serialVersionUID = 1L;
    /**
     * 地址ID
     */
    @TableId(type = IdType.ASSIGN_ID)
    @ApiModelProperty(value = "地址ID")
    private String id;

    /**
     * 商品ID
     */
    @ApiModelProperty(value = "商品ID")
    private String goodsId;

    /**
     * 商品地址ID
     */
    @ApiModelProperty(value = "商品地址ID")
    private String goodsAddressId;


    /**
     * 卖家ID
     */
    @ApiModelProperty(value = "卖家ID")
    private String sellerId;

    /**
     * 卖家地址ID
     */
    @ApiModelProperty(value = "卖家地址ID")
    private String sellerAddressId;


    /**
     * 买家ID
     */
    @ApiModelProperty(value = "买家ID")
    private String buyerId;

    /**
     * 买家地址ID
     */
    @ApiModelProperty(value = "买家地址ID")
    private String buyerAddressId;


    /**
     * 企业ID
     */
    @ApiModelProperty(value = "企业ID")
    private String enterpriseId;

    /**
     * 企业地址ID
     */
    @ApiModelProperty(value = "企业地址ID")
    private String enterpriseAddressId;

    /**
     * 商户ID
     */
    @ApiModelProperty(value = "商户ID")
    private String merchantId;


    /**
     * 店铺ID
     */
    @ApiModelProperty(value = "店铺ID")
    private String shopId;

    /**
     * 店铺地址ID
     */
    @ApiModelProperty(value = "店铺地址ID")
    private String shopAddressId;


    /**
     * 省级ID
     */
    @Excel(name = "省级ID", width = 15, dictTable = "ht_area", dicText = "name", dicCode = "id")
    @Dict(dictTable = "ht_area", dicText = "name", dicCode = "id")
    @ApiModelProperty(value = "省级ID")
    private String provinceId;
    /**
     * 市级ID
     */
    @Excel(name = "市级ID", width = 15, dictTable = "ht_area", dicText = "name", dicCode = "id")
    @Dict(dictTable = "ht_area", dicText = "name", dicCode = "id")
    @ApiModelProperty(value = "市级ID")
    private String cityId;
    /**
     * 区ID
     */
    @Excel(name = "区ID", width = 15, dictTable = "ht_area", dicText = "name", dicCode = "id")
    @Dict(dictTable = "ht_area", dicText = "name", dicCode = "id")
    @ApiModelProperty(value = "区ID")
    private String districtId;
    /**
     * 街道地址
     */
    @Excel(name = "街道地址", width = 15)
    @ApiModelProperty(value = "街道地址")
    private String streetAddress;
    /**
     * 楼/门牌号
     */
    @Excel(name = "楼/门牌号", width = 15)
    @ApiModelProperty(value = "楼/门牌号")
    private String suiteAddress;
    /**
     * 联系人
     */
    @Excel(name = "联系人", width = 15)
    @ApiModelProperty(value = "联系人")
    private String contactPerson;
    /**
     * 手机电话
     */
    @Excel(name = "手机电话", width = 15)
    @ApiModelProperty(value = "手机电话")
    private String phoneNumber;

    /** 验证码 */
    @NotNull(message = "验证码不能为空")
    @ApiModelProperty(value = "验证码")
    private String captcha;

    /**
     * 座机电话
     */
    @Excel(name = "座机电话", width = 15)
    @ApiModelProperty(value = "座机电话")
    private String telephone;
    /**传真*/
    @Excel(name = "传真", width = 15)
    @ApiModelProperty(value = "传真")
    private String fax;
    /**
     * 邮箱
     */
    @Excel(name = "邮箱", width = 15)
    @ApiModelProperty(value = "邮箱")
    private String email;
    /**
     * 邮编
     */
    @Excel(name = "邮编", width = 15)
    @ApiModelProperty(value = "邮编")
    private Integer zipcode;
    /**
     * 经度
     */
    @Excel(name = "经度", width = 15)
    @ApiModelProperty(value = "经度")
    private BigDecimal longitude;
    /**
     * 纬度
     */
    @Excel(name = "纬度", width = 15)
    @ApiModelProperty(value = "纬度")
    private BigDecimal latitude;
    /**
     * 是否默认地址：0-非默认地址，1-默认地址。
     */
    @Excel(name = "是否默认地址：0-非默认地址，1-默认地址。", width = 15)
    @ApiModelProperty(value = "是否默认地址：0-非默认地址，1-默认地址。")
    private Boolean isDefault;
    /**
     * 备注
     */
    @Excel(name = "备注", width = 15)
    @ApiModelProperty(value = "备注")
    private String remark;
    /**
     * 逻辑删除：0-未删除,1-删除。
     */
    @Excel(name = "逻辑删除：0-未删除,1-删除。", width = 15)
    @ApiModelProperty(value = "逻辑删除：0-未删除,1-删除。")
    private Boolean isDeleted;
    /**
     * 创建人
     */
    @ApiModelProperty(value = "创建人")
    private String createBy;
    /**
     * 创建时间
     */
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "创建时间")
    private Date createTime;
    /**
     * 更新人
     */
    @ApiModelProperty(value = "更新人")
    private String updateBy;
    /**
     * 更新时间
     */
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "更新时间")
    private Date updateTime;

    /**
     * 省名
     */
    @ApiModelProperty(value = "省名")
    private String provinceName;

    /**
     * 市名
     */
    @ApiModelProperty(value = "市名")
    private String cityName;

    /**
     * 区名
     */
    @ApiModelProperty(value = "区名")
    private String districtName;

    /**
     * 完整地址
     */
    private String fullAddress;

    public String getFullAddress() {
        String address = "";
        String separator = " ";
        if (oConvertUtils.isNotEmpty(this.provinceName)) {
            address += provinceName;
        }
        if (oConvertUtils.isNotEmpty(this.cityName)) {
            address += (separator + cityName);
        }
        if (oConvertUtils.isNotEmpty(this.districtName)) {
            address += (separator + districtName);
        }
        if (oConvertUtils.isNotEmpty(this.streetAddress)) {
            address += (separator + streetAddress);
        }
        if (oConvertUtils.isNotEmpty(this.suiteAddress)) {
            address += (separator + suiteAddress);
        }

        return address;
    }
}
